package com.qf.jie.dao.impl;

import com.qf.jie.dao.CartDao;
import com.qf.jie.entity.po.Cart;
import com.qf.jie.utils.DBUtils;

import java.util.List;

public class CartDaoImpl implements CartDao {

    @Override
    public int addBean(Cart cart) {
        return DBUtils.excuteUpdate("insert into `cart`(user_id, commodity_id) values(?,?)", cart.getUser_id(), cart.getCommodity_id());
    }

    @Override
    public int deleteById(int id) {
        return DBUtils.excuteUpdate("delete from `cart` where id=?", id);
    }

    @Override
    public List<Cart> getListByUser_id(int user_id) {
        return DBUtils.excuteQuery(Cart.class, "select * from `cart` where user_id=?", user_id);
    }

    @Override
    public List<Cart> getBeanById(int id) {
        return DBUtils.excuteQuery(Cart.class, "select * from cart where id=?", id);
    }

    @Override
    public int updateById(Cart cart) {
        return 0;
    }

    @Override
    public int shamDeleteById(int id) {
        return 0;
    }

    @Override
    public int getCount() {
        return 0;
    }

    @Override
    public int getIdByName(String name) {
        return 0;
    }

    @Override
    public int getCountByName(String name) {
        return 0;
    }

    @Override
    public int getIdByNameAndPassword(String name, String password) {
        return 0;
    }

    @Override
    public List<Cart> getList() {
        return null;
    }

    @Override
    public List<Cart> getList(int start, int len) {
        return null;
    }

    @Override
    public List<Cart> getListLike(String name) {
        return null;
    }


}
